/**

 */

import React, { PureComponent } from 'react';
import { Switch } from 'antd';
import style from '../index.less';
export default class MySwitch extends PureComponent {
  static defaultProps = {
    onChange: () => {},
    onRef: () => {},
  };
  constructor(props) {
    super(props);
    this.state = {};
  }
  componentDidMount() {
    this.props.onRef(this);
  }
  onChange = (e) => {
    this.props.onChange(e);
  };

  render() {
    return (
      <div className={style.mySwitch}>
        <span>持仓穿透</span>
        <Switch checked={this.props.checked} onChange={this.onChange} />
      </div>
    );
  }
}
